import axios from "axios";

axios.defaults.baseURL = "/api";
axios.defaults.headers.common["Content-Type"] =
  "application/x-www-form-urlencoded";

export default {
  methods: {
    async getProcess() {
      const { data: res } = await axios.get("/process");
      return res.data;
    },
    async addProcess(processData) {
      const { data: res } = await axios.post("/process", processData);
      return res;
    },
    async deleteProcessById(processId) {
      const { data: res } = await axios.delete(
        "/process/" + processId.toString()
      );
      return res;
    },
    async updateProcessById(processId, jsonData) {
      const { data: res } = await axios.put(
        "/process/" + processId.toString(),
        jsonData
      );
      return res;
    },
  },
};
